package com.xs.ai.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

@Configuration
public class KafkaConfig {

    @Bean
    public NewTopic emailReceivedTopic() {
        return TopicBuilder.name("email-received")
                .partitions(3)
                .replicas(1)
                .build();
    }

    @Bean
    public NewTopic meetingInviteTopic() {
        return TopicBuilder.name("meeting-invite")
                .partitions(3)
                .replicas(1)
                .build();
    }

    @Bean
    public NewTopic aiAnalysisCompleteTopic() {
        return TopicBuilder.name("ai-analysis-complete")
                .partitions(3)
                .replicas(1)
                .build();
    }

    @Bean
    public NewTopic userDecisionTopic() {
        return TopicBuilder.name("user-decision")
                .partitions(3)
                .replicas(1)
                .build();
    }
}
